<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>堆快照查找分离DOM</title>
</head>
<body>
    <button id="add">add</button>
	<script>
		var templates;
		function test(){
			let ul = document.createElement('ul')
			for(let i = 0 ; i < 10000 ; i++){
				ul.appendChild(document.createElement('li'))
			}
			templates = ul;
			templates = null;
		}
		const oAdd = document.getElementById('add')
		oAdd.onclick = test;
	</script>
</body>
</html>